package com.einmeer.hfbank.controller;

import com.einmeer.hfbank.service.TransferAccountsService;
import com.einmeer.hfbank.vo.ResultVo;
import jakarta.annotation.Resource;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.*;

/**
 * @author 芊嵛
 * @date 2024/1/13
 */
@RestController
@RequestMapping("/transferAccounts")
public class TransferAccountsController {
    @Resource
    private TransferAccountsService transferAccountsService;

    /**
     * 转账模块
     * @param collectionName
     * @param collectionNumber
     * @param collectionBankId
     * @param collectionAmount
     * @param commission
     * @param paymentNumber
     * @param cardPassword
     * @return
     */
    @PostMapping("/addTransferAccounts")
    @CrossOrigin
    public ResultVo addTransferAccounts(@RequestParam("collectionName") String collectionName,
                                        @RequestParam("collectionNumber") Long collectionNumber,
                                        @RequestParam("collectionBankId") Integer collectionBankId,
                                        @RequestParam("collectionAmount") String collectionAmount,
                                        @RequestParam("commission") String commission,
                                        @RequestParam("paymentNumber") Long paymentNumber,
                                        @RequestParam("cardPassword") Integer cardPassword){
        System.out.println(collectionName);
        System.out.println(collectionNumber);
        System.out.println(collectionAmount);
        System.out.println(collectionBankId);
        return transferAccountsService.addTransferAccounts(collectionName, collectionNumber, collectionBankId, collectionAmount, commission, paymentNumber,cardPassword);
    }
}
